Embodiments pertain to the field of rules application for computer systems, and, more particularly, to an approach for allowing controlled forward chaining within a ruleset.
In a multistep process, be it a large-scale business transaction, or a simple sale of goods, a number of rules govern the process. Often, these rules can be represented as if/then (or if/then/else) statements: if A occurs, then do B (or else do C). When some or all of the steps in the process occur on a computer, or when a computer program is used to support the process, these rules can be aggregated into a ruleset.
In many situations, however, the rules performed during a process will affect other rules. For example, consider the two rules presented below, in Table 1:
TABLE 1Rule 1: IF OrderValue > 1000THEN HighValueOrder = trueRule 2: IF HighValueOrder == trueTHEN Discount = 5%
Rule 1 simply states that if the value of the OrderValue variable is greater than 1000, then set the HighValueOrder variable equal to true. Rule two states that if HighValueOrder is equal to true, then sets the Discount variable equal to 5%. In business terms, rules 1 and 2 represent a 5% discount for a larger order, a fairly common occurrence.
A problem arises in attempting to automate a set of rules, or ruleset, where one rule may rely upon the outcome of another rule. Rule 2, as shown above, should be reevaluated every time Rule 1 is performed; more complicated rulesets may involve interrelationships between many more rules, such that the outcome of the application of one rule will affect other rules indirectly. More complex processes may involve different rulesets at different times, or may change rulesets with every step.